package com.multi.source.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.multi.source.domain.BkDataSign;
import com.multi.source.domain.BkDataSourceInfo;
import com.multi.source.domain.BkSqlInfo;
import com.multi.source.resp.DbSizeInfoResp;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description 查询通用信息Mapper
 * @ClassName SystemDbMapper
 * @Author pzj
 * @Data 2024/11/20 15:45
 */
@Repository
public interface SystemDbMapper {


    public List<DbSizeInfoResp> computeDbSize();

    /**
     * 调用不同的数据连接生成新的数据库
     * @param onlySign
     * @param dbName
     * @return
     */
    @DS(value = "#onlySign")
    public int createDataSource(String onlySign,@Param("dbName")String dbName);

    /**
     * 调用不同的数据连接创建数据表单
     * @param tenantId
     * @param sqlInfo
     * @return
     */
    @DS(value = "#tenantId")
    public int createDataTable(@Param("tenantId") String tenantId,@Param("sqlInfo") String sqlInfo);

    /**
     * 查询租户需要的sql信息
     * @param tenantType
     * @return
     */
    public BkSqlInfo selectSqlInfo(@Param("tenantType") String tenantType);
}
